/****************************************************************************************** 
 *	Chili DirectX Framework Version 12.04.24											  *	
 *	Game.h																				  *
 *	Copyright 2012 PlanetChili.net														  *
 *																						  *
 *	This file is part of The Chili DirectX Framework.									  *
 *																						  *
 *	The Chili DirectX Framework is free software: you can redistribute it and/or modify	  *
 *	it under the terms of the GNU General Public License as published by				  *
 *	the Free Software Foundation, either version 3 of the License, or					  *
 *	(at your option) any later version.													  *
 *																						  *
 *	The Chili DirectX Framework is distributed in the hope that it will be useful,		  *
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of						  *
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the						  *
 *	GNU General Public License for more details.										  *
 *																						  *
 *	You should have received a copy of the GNU General Public License					  *
 *	along with The Chili DirectX Framework.  If not, see <http://www.gnu.org/licenses/>.  *
 ******************************************************************************************/
#pragma once

#include "D3DGraphics.h"
#include "Keyboard.h"
#include "Mouse.h"
#include "Sound.h"
#include <string>

#define TOOLBARWIDTH 800
#define TOOLBARHEIGHT 200

class Game
{
public:
	Game( HWND hWnd,const KeyboardServer& kServer,const MouseServer& mServer );
	~Game();
	void Go();
private:

	void ComposeFrame();
	bool selectiondone;
	enum Character{REM,RAIN,BEEZEL};
	std::string charname[3];
	void Selection();
	Character selectedchar;
	void LoadMap(int mapId);
	void InGame();
	void DrawToolBar();
	void DrawGameScreen();
	void DrawM1L(int x ,int y);//character size is 36 by 40
	void DrawM1R(int x ,int y);
	void DrawBulletR(int x,int y);
	void DrawPlatform(int top,int bot,int left, int right );
	void DrawPlayer();
	void UpdatePlayer();
//this takes the camera into account
	/********************************/
	/*  User Functions              */

	/********************************/
private:
	HWND hwnd;//dunno if need this just put first remove later
	HDC hdc;
	//PAINTSTRUCT ps;
	D3DGraphics gfx;
	KeyboardClient kbd;
	MouseClient mouse;
	DSound audio;
	Sound lose;
	int MapWidth;
	int MapHeight;

	struct Platform//this assumes perfectly horizontal surface
	{
		int top;
		int bot;
		int left;
		int right;

	};
	enum weapon{PISTOL,CANNON,GRAPPLING,JETPACK};
	float speedofcharacter[3];
	float gravityc;
	float gravity;
	float frictionc;//cursor friction
	float friction;
	//later separate the below into a different class to use oop programming
	bool playerJumping;
	bool playerMoving;
	float PlayerX;//player position in the world
	float PlayerY;
	float PlayerHealth;//max health 100
	float charSpeed;
	float velocityX;
	float velocityY;
	enum Direction{LEFT,RIGHT};
	Direction PlayerDirection;
	int noOfPlatform;
	Platform *pPlatform;//pointer to dyamically created array of  platform
	int SPlatform;//SPlatform stores the Platform that the character is currently standing on
};